package com.gxa.ssm340.service.impl;

import com.gxa.ssm340.common.PageDTO;
import com.gxa.ssm340.entity.dto.NameOrTimeDTO;
import com.gxa.ssm340.entity.pojo.BrandIntegral;
import com.gxa.ssm340.mapper.IntegralMapper;
import com.gxa.ssm340.service.IntegralService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 叶骏
 * @description: TODO
 * @date 2023-10-21 15:32:23
 * @version: 1.0
 */
@Service
@Transactional(propagation = Propagation.REQUIRED)
public class IntegralServiceImpl implements IntegralService {
    @Autowired
    private IntegralMapper integralMapper;

    @Override
    public List<BrandIntegral> getAll() {
        final List<BrandIntegral> all = integralMapper.getAll();
        return all;
    }

    @Override
    public List<BrandIntegral> selectByNameOrTime(NameOrTimeDTO dto) {
        final List<BrandIntegral> list = integralMapper.selectByNameOrTime(dto);
        return list;
    }

    @Override
    public List<BrandIntegral> getByPage(PageDTO pageDTO) {
        final List<BrandIntegral> byPage = integralMapper.getByPage(pageDTO);
        return byPage;
    }

    @Override
    public Integer count() {
        final Integer count = integralMapper.count();
        return count;
    }
}
